<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>let、const、var之间的区别</title>
    </head>
    <body>
        <h1>let、const、var之间的区别</h1>
        <script>
            // function test(){
            //     var i=1;
            //     console.log(i);
            //     console.log(j);
            //     var j=2;
            // }
            // test();
            // console.log(i);//报错
            // function test(){
            //     let i=1;
            //     console.log(i);
            //     console.log(j);//j is not defined
            //     let j=2;
            // }
            // test();
            // console.log(i);//i is not defined
            // const names=[] ;
            // names.push("1") ;
            // console.log (names);
            //数组
            // const names = [ ] ;
            // names=[];//Uncaught TypeError: Assignment to constant variable.
            // //number或String
            // const i=1;
            // i=2;//Uncaught TypeError: Assignment to constant variable.
        </script>
    </body>
</html>